home *** CD-ROM | disk | FTP | other *** search
/ Inventor Labs: Technology / INVENTORLABS_TECHNOLOGY.BIN / mac / FILES / EDISON.DIR / 00467_Script_AutoTele parent < prev    next >
Text File  |  1997-05-26  |  5KB  |  160 lines

  1. --p telegraph
  2.  
  3. property pSectionStartSprite, pNumOfSection, pKeysStartSprite
  4. property pKeysDB, pStartFrame, pActiveSection, pCursorlst
  5.  
  6. property pInstructionTxtCast, pNumOfLetter
  7.  
  8. global gActorListMgrObj, pQTsprite, pAutoTeleSeq, gInterfaceMgrObj, gSndPath, gUtilityObj
  9.  
  10. ----------------------------------------------------------------------------------------------------------------
  11. on mInit me
  12.   
  13.   cursor 4
  14.   Sound playFile 2, gSndPath & "EAUINTR.AIF"
  15.   
  16.   set pSectionStartSprite = 2
  17.   set pNumOfSection = 4
  18.   --set pKeysStartSprite = pSectionStartSprite + pNumOfSection -1
  19.   set pKeysStartSprite = 6
  20.   set keydbtext = the text of cast "AutoTele keys"
  21.   set pKeysDB = [value(line 1 of keydbtext), value(line 2 of keydbtext),value(line 3 of keydbtext),value(line 4 of keydbtext)]
  22.   set pStartFrame = the frame
  23.   
  24.   set pActiveSection = 1
  25.   set pQTsprite = 23
  26.   set the movietime of sprite pQTsprite = 0
  27.   set pAutoTeleSeq = []
  28.   set pCursorlst = [:]
  29.   repeat with SpriteNum = pSectionStartSprite to (pSectionStartSprite + pNumOfSection)
  30.     addprop(pCursorlst,SpriteNum,#FINGER)
  31.   end repeat
  32.   addprop(pCursorlst,1,#Operate)
  33.   set pInstructionTxtCast = the number of cast "instrTxt"
  34.   mUnSetAllCursors (gUtilityObj)
  35.   mSetCursors (gUtilityObj, pCursorlst)
  36.   mSetCursors(gUtilityObj, [21:#Return, 22:#Return])
  37.   
  38.   mSetToolBtns (gInterfaceMgrObj, #TELEGRAPH, me)
  39.   mClearToolHilite (gInterfaceMgrObj)
  40.   set pNumOfLetter = 0
  41.   
  42.   cursor -1
  43.   return( me )
  44.   
  45. end mInit
  46. ----------------------------------------------------------------------------------------------------------------
  47. on mclose me
  48.   
  49.   puppetsprite 4, false
  50.   mUnSetAllCursors (gUtilityObj)
  51.   
  52. end mclose
  53. ----------------------------------------------------------------------------------------------------------------
  54. on mStepFrame me
  55.   
  56.   if rollover( pSectionStartSprite ) then set pActiveSection = 1
  57.   else if rollover( pSectionStartSprite + 1) then set pActiveSection = 2
  58.   else if rollover( pSectionStartSprite + 2) then set pActiveSection = 3
  59.   else if rollover( pSectionStartSprite + 3) then set pActiveSection = 4
  60.   go frame (pStartFrame + pActiveSection)
  61.   
  62. end mStepFrame
  63. ----------------------------------------------------------------------------------------------------------------
  64. on mKeyPressed me
  65.   
  66.   
  67.   set WhatKey = (the clickon - pKeysStartSprite) + 1
  68.   set section = getat( pKeysDB, pActiveSection)
  69.   set offset = getat([0,6,20,26] ,pActiveSection)
  70.   set Index = WhatKey + offset
  71.  
  72.   set start = (WhatKey + offset - 1) * 8
  73.   
  74.   sound stop 2
  75.   puppetsound 2, (the number of cast "EAUKYSND.AIF")
  76.   repeat with counter = 1 to 3
  77.     set start = start + counter
  78.     set the movietime of sprite pQTsprite =  start
  79.     updatestage
  80.   end repeat
  81.   
  82.   sound stop 2
  83.   if (count(pAutoTeleSeq) < 14) then
  84.     append( pAutoTeleSeq, Index)
  85.     if the movietime of sprite (pQTsprite + 1)> 1 then  
  86.       sound stop 2
  87.       updatestage
  88.       set the movietime of sprite  (pQTsprite + 1) = 20
  89.     end if
  90.     
  91.     updatestage
  92.     set the movierate of sprite  (pQTsprite + 1) = 1
  93.     updatestage
  94.     repeat while the movietime of sprite  (pQTsprite + 1) = 1
  95.       updatestage
  96.     end repeat
  97.     
  98.     set the movietime of sprite pQTsprite = start - 5
  99.     updatestage
  100.     
  101.   else mSetUpTape( me )
  102.  
  103.   if (Index = 26) then mSetUpTape( me )
  104.   
  105. end mKeyPressed
  106. ----------------------------------------------------------------------------------------------------------------
  107. on mSetUpTape me
  108.   
  109.   sound stop 2
  110.   mUnSetAllCursors (gUtilityObj)
  111.   mSetCursors(gUtilityObj, [21:#Return, 22:#Return])
  112.   go "Message"
  113.   
  114.   
  115. end mSetUpTape
  116. ----------------------------------------------------------------------------------------------------------------
  117. on mSetZoomCursor me
  118.   
  119.   set handcursor = the number of cast "zoom in.pic"
  120.   set the cursor of sprite 12 = [handcursor, handcursor + 1]
  121.   
  122.   
  123. end mSetZoomCursor
  124. ----------------------------------------------------------------------------------------------------------------
  125. on mWriteTape me
  126.   
  127.   set numofLetters = count( pAutoTeleSeq )
  128.   puppetsprite 4, True
  129.   set pLetterStartCast = the number of cast "EAU1.PIC" 
  130.   set currloch = the loch of sprite 4
  131.   
  132.   repeat with counter = 1 to numofLetters
  133.     set the castnum of sprite 4 = pLetterStartCast + getat(pAutoTeleSeq, counter) - 1
  134.     updatestage
  135.     if counter < numofLetters then
  136.       set currloch = currloch + 32
  137.       set the loch of sprite 4 = currloch 
  138.     end if
  139.   end repeat
  140.   
  141.   
  142. end mWriteTape
  143. ------------------------------------------------------------------------------------------------------------------ò
  144. on mZoom me, WhatactiveRect
  145.   
  146.   if WhatactiveRect = 1 then go frame "Tape Zoom"
  147.   else go frame "Zoom Reciever"
  148.   mClearToolHilite (gInterfaceMgrObj)
  149.   
  150. end mZoom
  151. ------------------------------------------------------------------------------------------------------------------ò
  152. on mOperate me, WhatactiveRect
  153.   
  154.   if WhatactiveRect = 1 then go frame "TELEGRAPH"
  155.   else if WhatactiveRect = 2 then go frame "Transmitter"
  156.   else go frame "Reciever"
  157.   mClearToolHilite (gInterfaceMgrObj)
  158.   
  159. end mOperate
  160. ------------------------------------------------------------------------------------------------------------------ò